﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Zeitgeist.aspx.cs" Inherits="IL2SWA.Zeitgeist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
	
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
    google.load("visualization", "1", { packages: ["corechart"] });
</script> 
<script type="text/javascript">

         $(document).ready(function () {
                 $.ajax({
                     type: "POST",
                     url: "Zeitgeist.aspx/GetMissionPilots",
                     data: "{}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     async: true,
                     success: function (msg) {
                         drawGetMissionPilots(msg.d);
                         // Replace the div's content with the page method's return.
                         //$("#Result").text(msg.d);
                     },
                     error: function (result) {
                         alert('error occured');
                     }
                 });
                 $.ajax({
                     type: "POST",
                     url: "Zeitgeist.aspx/GetMissionPilotsBlueAir",
                     data: "{}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     async: true,
                     success: function (msg) {
                         drawGetMissionPilotsBlueAir(msg.d);
                         // Replace the div's content with the page method's return.
                         //$("#Result").text(msg.d);
                     },
                     error: function (result) {
                         alert('error occured');
                     }
                 });
                 $.ajax({
                     type: "POST",
                     url: "Zeitgeist.aspx/GetMissionPilotsRedAir",
                     data: "{}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     async: true,
                     success: function (msg) {
                         drawGetMissionPilotsRedAir(msg.d);
                         // Replace the div's content with the page method's return.
                         //$("#Result").text(msg.d);
                     },
                     error: function (result) {
                         alert('error occured');
                     }
                 });
                 $.ajax({
                     type: "POST",
                     url: "Zeitgeist.aspx/GetMissionPilotsBlueGround",
                     data: "{}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     async: true,
                     success: function (msg) {
                         drawGetMissionPilotsBlueGround(msg.d);
                         // Replace the div's content with the page method's return.
                         //$("#Result").text(msg.d);
                     },
                     error: function (result) {
                         alert('error occured');
                     }
                 });
                 $.ajax({
                     type: "POST",
                     url: "Zeitgeist.aspx/GetMissionPilotsRedGround",
                     data: "{}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     async: true,
                     success: function (msg) {
                         drawGetMissionPilotsRedGround(msg.d);
                         // Replace the div's content with the page method's return.
                         //$("#Result").text(msg.d);
                     },
                     error: function (result) {
                         alert('error occured');
                     }
                 });
             
         });

             function drawGetMissionPilots(dataValues) {

             var data = new google.visualization.DataTable(dataValues);
             new google.visualization.LineChart(document.getElementById('GetMissionPilots')).
                draw(data, { title: "Player Mission Breakdown",curveType: 'function',colors :['black','blue','red'] });
         }

         function drawGetMissionPilotsBlueAir(dataValues) {

             var data = new google.visualization.DataTable(dataValues);
             new google.visualization.LineChart(document.getElementById('GetMissionPilotsBlueAir')).
                draw(data, { title: "Mission %Blue Pilot % Air Destroyed", curveType: 'function',colors :['blue','black'] });
         }

         function drawGetMissionPilotsRedAir(dataValues) {

             var data = new google.visualization.DataTable(dataValues);
             new google.visualization.LineChart(document.getElementById('GetMissionPilotsRedAir')).
                draw(data, { title: "Mission %Red Pilot % Air Destroyed", curveType: 'function',colors :['red','black'] });
         }

         function drawGetMissionPilotsBlueGround(dataValues) {

             var data = new google.visualization.DataTable(dataValues);
             new google.visualization.LineChart(document.getElementById('GetMissionPilotsBlueGround')).
                draw(data, { title: "Mission %Blue Pilot % Ground Destroyed", curveType: 'function', colors: ['blue', 'black'] });
         }

         function drawGetMissionPilotsRedGround(dataValues) {

             var data = new google.visualization.DataTable(dataValues);
             new google.visualization.LineChart(document.getElementById('GetMissionPilotsRedGround')).
                draw(data, { title: "Mission %Red Pilot % Ground Destroyed", curveType: 'function', colors: ['red', 'black'] });
         }
</script> 
     <div id="GetMissionPilots" style="min-width: 600px; height: 600px; margin: 0 auto"></div>
     <div id="GetMissionPilotsBlueAir" style="min-width: 600px; height: 600px; margin: 0 auto"></div>
     <div id="GetMissionPilotsRedAir" style="min-width: 600px; height: 600px; margin: 0 auto"></div>
     <div id="GetMissionPilotsBlueGround" style="min-width: 600px; height: 600px; margin: 0 auto"></div>
     <div id="GetMissionPilotsRedGround" style="min-width: 600px; height: 600px; margin: 0 auto"></div>
</asp:Content>
